package com.palm.core.data;

import java.io.Serializable;
import java.util.List;

import lombok.Data;
@Data
public class Item implements Serializable,Comparable<Item> {
    private String key;
    private String title;
    private String parent;
    private Integer order;
    private List<Item> children;
    public Item(){

    }
    public Item(String key, String title) {
        this.key = key;
        this.title = title;
    }

    @Override
    public int compareTo(Item o) {
        int thisOrder=order==null?0:this.order;
        int thatOrder=o.order==null?0:o.order;
        return this.order-thatOrder;
    }
}
